<table>
    <tr>
    {% for page in pages.object_list %}
       <td>{% include page.layout with page=page%}</td>
    {% empty %}
        <td>
           <p>No pages in this album yet, would you like to 
           <a href="{% url add_page album.id %}">add one</a>?</p>
        </td>
    {% endfor %}
    </tr>
</table>
<div class="pagination">
    <span class="step-links">
        {% if pages.has_previous %}
            {% if user.is_authenticated and user.is_active %}
                <a id="album_prev_page_link" href="{% url show_page album.id pages.previous_page_number %}">previous</a>
			{% else %}
			    <a id="album_prev_page_link" href="{% url show_page album.id pages.previous_page_number %}?public_token={{album.public_token}}">previous</a>
			{% endif %}
        {% endif %}

        {% if pages.paginator.count > 0 and pages.paginator.num_pages > 1 %}
        <span class="current">
            Page {{ pages.number }} of {{ pages.paginator.num_pages }}.
        </span>
        {% endif %}

        {% if pages.has_next %}
            {% if user.is_authenticated and user.is_active %}
            <a id="album_next_page_link" href="{% url show_page album.id pages.next_page_number %}">next</a>
            {% else %}
            <a id="album_next_page_link" href="{% url show_page album.id pages.next_page_number %}?public_token={{album.public_token}}">next</a>
            {% endif %}
        {% endif %}
    </span>
</div>